﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using XRM.Security.DataAccess.Models;
using XRM.Security.DataAccess.Enums;
namespace XRM.Security.DataAccess.Helpers
{
    public class Utils
    {
        public static CertStatus GetSertStatus(DateTime toDate, UserRegister user)
        {
            DateTime dateNow = DateTime.Today.Date;
            if ((dateNow > toDate) || (user.Status != (int)UserStatus.Work))
                return CertStatus.NotValid;
            else if (dateNow.AddDays(29) > toDate)
                return CertStatus.ExpireSoon;
            else
                return CertStatus.Valid;
        }
    }
}